﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Derbster.Domain;

using Microsoft.Practices.Unity;

namespace Derbster.Data
{
    public static class UnityConfiguration
    {
        public static IUnityContainer ConfigureUnityContainer(IUnityContainer unityContainer)
        {
            if (unityContainer == null)
                unityContainer = new UnityContainer();

            unityContainer.RegisterType<IDerbsterContext, DerbsterDbContext>();
            unityContainer.RegisterType<ILeagueRepository, DbLeagueRepository>();
            unityContainer.RegisterType<IMatchRepository, DbMatchRepository>();
            unityContainer.RegisterType<IOfficialRepository, DbOfficialRepository>();
            unityContainer.RegisterType<ISkaterRepository, DbSkaterRepository>();
            unityContainer.RegisterType<ITeamRepository, DbTeamRepository>();

            return unityContainer;
        }
    }
}
